<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Leaflet WMS Example</title>
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" />
</head>

<body>

<div id="map" style="width: 100%; height: 500px;"></div>

<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"></script>
<script>
    // 初始化地图并设置中心和缩放级别
    var map = L.map('map').setView([0, 0], 2); // 这里的[0, 0]是地图的初始中心，2是初始的缩放级别

    // 添加OSM底图
    L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
        maxZoom: 19,
        attribution: '© OpenStreetMap contributors'
    }).addTo(map);

    // 添加WMS图层
    var wmsLayer = L.tileLayer.wms("http://192.168.1.249:8080/geoserver/ows?", {
        layers: 'wuxi:20200524',
        format: 'image/png',
        transparent: true,
        version: '1.1.0'
    }).addTo(map);
</script>

</body>

</html>
